using Godot;

namespace GodotThirdGame.Scripts;

public partial class Mob : RigidBody2D
{
    [Export] public AnimatedSprite2D Anims;
    public override void _Ready()
    {
        Anims = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
        string[] mobTypes = Anims.SpriteFrames.GetAnimationNames();
        string ranMobType = mobTypes[GD.Randi() % mobTypes.Length];
        Anims.Play(ranMobType);
    }

    private void OnLeaveScreen()
    {
        QueueFree();
    }
}